UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iTiCn5cDsGGSxJO5htIDvzwfDvQAyjUSwmDKZfw4ucQ='
WHERE
key_id = '87f1d867f49b721f3d944ea236107bcfd275efc7578b00b9a35a63560bf3a3c3'
AND (
token = 'iTiCn5cDsGGSxJO5htIDvzwfDvQAyjUSwmDKZfw4ucQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)