UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3Bdaeav14bqEfR8jfVSySoIEtwifMvclWCUvDDI/z1M=' 
WHERE 
  key_id = '7e775a100ef9f0c6d82f94251c4757998137af8fa0123508c36a14d9a14f29b7' 
  AND (
    token = '3Bdaeav14bqEfR8jfVSySoIEtwifMvclWCUvDDI/z1M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042