UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cFWI41I6xD5IqCPyn2SgPMo+LpLv6JJvRCylHegNx2M=' 
WHERE 
  key_id = '6cc2f3404dd026fdea8701ca082fe8e5d35bb78efe9cce9bfbfd373f91f37be6' 
  AND (
    token = 'cFWI41I6xD5IqCPyn2SgPMo+LpLv6JJvRCylHegNx2M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027