UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jLhAAWTO5epvEBrCvBXn5lSqeH0K88mc/brK+IQ497E='
WHERE
key_id = 'dfa711a60832ef157345a5d6d0b0c439e9674e6ff82eced8b4a63609a471803c'
AND (
token = 'jLhAAWTO5epvEBrCvBXn5lSqeH0K88mc/brK+IQ497E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)