UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '33nPqWwZDrspSEiAua8NpO1Z8UeC17iwgu8ZYErvW9I=' 
WHERE 
  key_id = 'ce3d8e044f0d90c93fad25697e94a96a79a3cb6ab3b23da445b8ebe3a970f658' 
  AND (
    token = '33nPqWwZDrspSEiAua8NpO1Z8UeC17iwgu8ZYErvW9I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018