UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'M1dT/bYNVtDRkOO2faJfqVuraVO8lvgx8FpzF1nB74o='
WHERE
key_id = 'ed06046cba6aaede2be074a9dd7b8de2c37e77c7b68435fc572fae55922f6b86'
AND (
token = 'M1dT/bYNVtDRkOO2faJfqVuraVO8lvgx8FpzF1nB74o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)