UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'g4ZYznFBN6rTfHyGLUouvf0F+vJ3rEgGIQVR5zEG8FA='
WHERE
key_id = 'd18489629591d00006781f1953a0b5a6dcbc55eda73d7484d89867c2904f9187'
AND (
token = 'g4ZYznFBN6rTfHyGLUouvf0F+vJ3rEgGIQVR5zEG8FA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)