UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/rHFnRez8dL0P2dJQc65ivDNEI1P5sPGaVRYG9OFBZ8='
WHERE
key_id = 'b707f65d332257387d23e27fb7013486486b07d02cce1c3e0bf8951cbf1238b3'
AND (
token = '/rHFnRez8dL0P2dJQc65ivDNEI1P5sPGaVRYG9OFBZ8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)