UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eLFr2nheFon64CsB6kWTuojXiWYIrFNOVfrbkxUGIOo='
WHERE
key_id = '1e8a4d2d8e842950acb44ac144a1f7f5847d279db84561a968b33ee2cafb5831'
AND (
token = 'eLFr2nheFon64CsB6kWTuojXiWYIrFNOVfrbkxUGIOo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)