UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'e2mDzqY+I6JQf9qrMj0PRUlpSElQgPhPuPhRvvhG2DM='
WHERE
key_id = '83575ebf451c971a72ee875d31e1d6ae35c218f69682a8a9b2e47cc788cd5955'
AND (
token = 'e2mDzqY+I6JQf9qrMj0PRUlpSElQgPhPuPhRvvhG2DM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)