UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bbR5YvhwYICi4ahCsy8BqpuurHEFQ6iYDtltyHdXFLM=' 
WHERE 
  key_id = '935b4a6ecd6c9af44979ebaa729450030ff41324b3208eade4bc5fbbe264fb31' 
  AND (
    token = 'bbR5YvhwYICi4ahCsy8BqpuurHEFQ6iYDtltyHdXFLM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030