UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zvGY/VzAPDCWBhJPjVZKzZF9Qqt6KJKYS6z7gdiaZzQ=' 
WHERE 
  key_id = 'b432b5ce174422af97144a4b3ba2278238901fdcc30246c6db07b3df793c58ff' 
  AND (
    token = 'zvGY/VzAPDCWBhJPjVZKzZF9Qqt6KJKYS6z7gdiaZzQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019