UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sWCAR9lIXtEUHmANteZkAv/WHDoA77c/EpynUnrqqFA=' 
WHERE 
  key_id = 'cc5c6cfb54b54979c7163222267b2095397881988ff621ffe039b338555b1db3' 
  AND (
    token = 'sWCAR9lIXtEUHmANteZkAv/WHDoA77c/EpynUnrqqFA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033