UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6egDK5gkQJeVJEK7NS0EVLDyTlkwf19DgzUm4qBvUWI='
WHERE
key_id = '7f2d997fd6d13bd21194a775a570f07eb57aa4de992a7aabf1dccd57e05f7ec7'
AND (
token = '6egDK5gkQJeVJEK7NS0EVLDyTlkwf19DgzUm4qBvUWI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)