UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GZkqhKLygG1iEYWPY7bfxUoY3x8peoO9McRAk+Ueg1w=' 
WHERE 
  key_id = 'ee73849e5ff959e1386ac74c5b6eaf1ceae53db4491bd7043c8975a18cef0922' 
  AND (
    token = 'GZkqhKLygG1iEYWPY7bfxUoY3x8peoO9McRAk+Ueg1w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00056