UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EW8apHMvP/Om6CHu0XoIjzIYbg9sj2bmoytaW2QvI8c='
WHERE
key_id = 'a1eedc38a768775330dba0d44bc2524873ef53e69cd12f10712e20b160ce1e07'
AND (
token = 'EW8apHMvP/Om6CHu0XoIjzIYbg9sj2bmoytaW2QvI8c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)