UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'q2J98NhrOt34zj9/27Xp8vzJ9i1IKmtZXmUfrt3zTDY=' 
WHERE 
  key_id = '332bc64f3fb299ae073e6b8288aab5387159f780781417ba0700409d755346b0' 
  AND (
    token = 'q2J98NhrOt34zj9/27Xp8vzJ9i1IKmtZXmUfrt3zTDY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022