UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OB39hFVJX4y9Xo5C6N3DfT+5eHX9zC8Pjx6AhgWdzGE=' 
WHERE 
  key_id = 'bac2c11a00b2d643e0312bf27da75c4758aa84e1dc0c9a40987d69d22eeb7a2c' 
  AND (
    token = 'OB39hFVJX4y9Xo5C6N3DfT+5eHX9zC8Pjx6AhgWdzGE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035