UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AgpRENIIfB2Vl/FWDYvo9TWNtWjIfh5CjPnJsV5pU8g='
WHERE
key_id = 'b222702b2ba1773fa33a92c9f3a3d1773fa3cdac73ad6422bb0283dd510a3ff1'
AND (
token = 'AgpRENIIfB2Vl/FWDYvo9TWNtWjIfh5CjPnJsV5pU8g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)