UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cm6oyCSU+j1kov4dFhpKdpbr7tOfEsj1bMkF1JoodkE='
WHERE
key_id = '09784b7711ca1e726184bd35c1a28ba10b0382bd8804c4b6e3b4181de5daf826'
AND (
token = 'cm6oyCSU+j1kov4dFhpKdpbr7tOfEsj1bMkF1JoodkE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)