UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1kvRFajX27xBLz4q704zm/Dvo/0b3DoyDAykjENQqdY=' 
WHERE 
  key_id = 'a866afa303a650bac7457d1ea5f8c2b9c35fdd51e4f00ea6e1b3bee2183203fd' 
  AND (
    token = '1kvRFajX27xBLz4q704zm/Dvo/0b3DoyDAykjENQqdY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030