UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1jN6ZbB6B6DcVHtCpiKdFNEI6emMnbmLAc5T0ZMfh1U='
WHERE
key_id = 'fac9be41a7c7b51aba149d48f440eda30d528dd1ce4930dcf59ed19e676fc502'
AND (
token = '1jN6ZbB6B6DcVHtCpiKdFNEI6emMnbmLAc5T0ZMfh1U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)