UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aJjD0tu5pK9lijUjeZLdGKD0Tjk05Uk5CwKYybibkcg='
WHERE
key_id = 'b53a2d1cf313de6db779a5da25d09f6037c8edc39ad14e3c610b42253f1565ca'
AND (
token = 'aJjD0tu5pK9lijUjeZLdGKD0Tjk05Uk5CwKYybibkcg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)