UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PQgFO32dv1dIu+swJrfcsr2OKQCHTtaDArv6jxIi+GI='
WHERE
key_id = '418da60c0be5bc26118fca3b3deaf57befc7d7666e6fcc1a7c68c18ef5130d07'
AND (
token = 'PQgFO32dv1dIu+swJrfcsr2OKQCHTtaDArv6jxIi+GI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)