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