UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'X9pyRe10gZzbUBnH5wBy5z/Nn2V7TasOOL8UEj6YiGA=' 
WHERE 
  key_id = '8ceb40c04331cda609087964d6069398e2b355ab2a9d927247e02e4938c6ac63' 
  AND (
    token = 'X9pyRe10gZzbUBnH5wBy5z/Nn2V7TasOOL8UEj6YiGA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030