UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BlY2bLypHo/TBmhRPqdCwX4Pr+cVME5rLf6GGNCCY1A='
WHERE
key_id = '8f4ab146ae03c7573b4cd9ade7207f929d7695340556d01ca4508ede0b2efe25'
AND (
token = 'BlY2bLypHo/TBmhRPqdCwX4Pr+cVME5rLf6GGNCCY1A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)