UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2XOwTsrqxyyEbH0amZoKg+hIEYzRpAOdZSREw3OPt58='
WHERE
key_id = 'e92e529025e7d8acfccfbf2a113adaa020cbd6e912a7967a51bfd729a76017b6'
AND (
token = '2XOwTsrqxyyEbH0amZoKg+hIEYzRpAOdZSREw3OPt58='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)