UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SkaOqwAPxeBhraM5XYuS8l/ShHz4LlN3ecx4NOvvXFw=' 
WHERE 
  key_id = 'e8ed551b816b15f741eeea8160102cd43487c1c75ef05c645af49f78d3490564' 
  AND (
    token = 'SkaOqwAPxeBhraM5XYuS8l/ShHz4LlN3ecx4NOvvXFw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019