UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DPfdgOg/9Gzkf00n30GrHpehSsRxp6ogGst4NT2FY5w='
WHERE
key_id = '502af2483393b77c5f3628fe9a91a7290e6b06cfa1ac961090fcb9400ce62aff'
AND (
token = 'DPfdgOg/9Gzkf00n30GrHpehSsRxp6ogGst4NT2FY5w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)