UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zyqPlf7hr8uKj0paaTNmXSrobVq6w9nHqMjXVkaGvBg='
WHERE
key_id = 'a19d285f3bba8933cdb3ae62539c4d22aca7cf3b87cbb37809c4262fb86482ca'
AND (
token = 'zyqPlf7hr8uKj0paaTNmXSrobVq6w9nHqMjXVkaGvBg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)