UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'C0i/CvdpFWVdAaAt/HpvlWBMhJipIU9qSKbGokQiE+c='
WHERE
key_id = 'cdeb319497f0fe46e4cd4b5f258d8a538df344917bd85d33a4619366894fa81a'
AND (
token = 'C0i/CvdpFWVdAaAt/HpvlWBMhJipIU9qSKbGokQiE+c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)