UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hRpbt404Bt4sOTOl3R96iZPGHMQNTC/L/VuVkcVy5Ds='
WHERE
key_id = '2a05068f78b0b642f33a86d5bdf38f2cbede6983d63d1237c4d506c938608a5d'
AND (
token = 'hRpbt404Bt4sOTOl3R96iZPGHMQNTC/L/VuVkcVy5Ds='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)