UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kSSIiMZi4D2Bx3/0OqvTtMCmUrYyWIxsoiDqtDFJPVg=' 
WHERE 
  key_id = '629b1d48d2beb8955e0bc790c4027d6479d1813d22e8efe616e915bcd41e27f3' 
  AND (
    token = 'kSSIiMZi4D2Bx3/0OqvTtMCmUrYyWIxsoiDqtDFJPVg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00056